package com.zw.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class HelloDockerComposeController {
    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @RequestMapping("/hello")
    public String hello()
    {
        Long view = stringRedisTemplate.opsForValue().increment("views");
        return "当前浏览量为："+view;
    }
}
